<?php
namespace Api
{

     class  Arrays
     {
        /**
         * Check if in array exists keys.
         * @param keys - array or mixed value 
         * @param search - An array with keys to check.
         * @return true or false
         */
        static public function Exists($keys, $search)
        {
           if(!is_array($search)) return false;
            
            if(is_array($keys))
            {
                foreach($keys as $k => $v)
                {
                    if(!array_key_exists($v, $search)) return false;
                }
                return true;
            }else
                return array_key_exists($keys, $search);
 
            return false;
        }
        
        /**
         * Check if specific keys are no empty
         * @param keys - array or mixed value 
         * @param search - An array with keys to check.
         * @return true or false
         */
        static public function IsEmpty($keys, $search)
        {
            if(!is_array($search)) return false;
            
            if(is_array($keys))
            {
                foreach($keys as $k => $v)
                {
                    if(empty($search[$v])) return false;
                }
            }else
                return empty($search[$v]);
        }
     }
}
?>